<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>Shift</title>
        <h:outputStylesheet library="css" name="css-version2.css"/>
        <h:outputScript library="js" name="js-primefaces.js"/>
    </h:head>
    <h:body>
        <h:form id="form-menu" rendered="#{usuarioBean.usuario != null}">
            <nav class="menu menu-vertical">
                <h3>SHIFT</h3>
                <h:link id="btninicio"
                        outcome="/restrito/home.xhtml"
                        value="Início"/>

                <h:link id="btncadastrar"
                        rendered="#{usuarioBean.isPapel('ROLE_ADMIN')}"
                        outcome="/admin/cadastros.xhtml"
                        value="Cadastro"/>
                
                <h:link id="btnprocessamento"
                        rendered="#{!usuarioBean.isPapel('ROLE_ADMIN')}"
                        outcome="/restrito/processamento.xhtml"
                        value="Processamento"/>

                <h:link id="btnpesagem"
                        rendered="#{usuarioBean.isPapel('ROLE_PESAGEM') or usuarioBean.isPapel('ROLE_ADMIN')}"
                        value="Pesagem"
                        outcome="/restrito/lote/pesagem/lote.xhtml"/>

                <h:link id="btnpesquisar"
                        value="Pesquisar"
                        outcome="/restrito/lote/pesquisa-lote.xhtml" />

                <h:link id="btnrelatorio"
                        value="Relatórios"
                        outcome="/restrito/relatorio/relatorio.xhtml"/>

                <a onclick="document.location = '#{request.contextPath}/j_spring_security_logout'" href="#">
                    Sair
                </a>
                
                <a class="active-link" style="position: absolute; bottom: 0; color: #003018">&copy; BPMLab</a>
            </nav>
        </h:form>
        
        <div class="content">
            <ui:insert name="content" />
        </div>
    </h:body>
</html>
